<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@ include file="/WEB-INF/page/common/taglib.jsp"%>

<#list entityClass.declaredFields as field>
	<#if !statics["java.lang.reflect.Modifier"].isStatic(field.getModifiers()) >
		<#if field.getAnnotation(IdClass)?? >
			<#--<input type="hidden" value="${"${" + field.name + "}"}"  />-->
		<#else>
			<div class="form-group">
				<#if field.type.name == "java.lang.String">
					<label for="">${fn_label(field)}</label>
					<input type="text" name="${field.name}" class="form-control" value="${fn_el(entityVarName + "." +field.name)}" placeholder="输入${fn_label(field)}"/>
				<#elseif field.type.name == "java.lang.Integer">
					<label for="">${fn_label(field)}</label>
					<input type="number" name="${field.name}" class="form-control" value="${fn_el(entityVarName + "." +field.name)}" placeholder="输入${fn_label(field)}"/>
				<#elseif field.type.name == "java.lang.BigDecimal">
					<label for="">${fn_label(field)}</label>
					<input type="number" name="${field.name}" class="form-control" value="${fn_el(entityVarName + "." +field.name)}" placeholder="输入${fn_label(field)}"/>
				<#elseif field.type.name == "java.lang.Boolean">
					<div class="checkbox">
				      <label>
				      	<c:choose>
					      	<c:when test="${fn_el(entityVarName + "." +field.name)}">
						        <input type="checkbox" name="${field.name}" checked />
					        </c:when>
					        <c:otherwise>
					        	<input type="checkbox" name="${field.name}" />
					        </c:otherwise>
				        </c:choose>
						${fn_label(field)}
				      </label>
				    </div>
				<#elseif field.type.name == "java.util.Date">
					<label for="">${fn_label(field)}</label>
					<input type="date" name="${field.name}" class="form-control" value="${fn_el(entityVarName + "." +field.name)}" placeholder="输入${fn_label(field)}"/>
				<#else>
					<label for="">${fn_label(field)}</label>
					<input type="text" name="${field.name}" class="form-control" value="${fn_el(entityVarName + "." +field.name)}" placeholder="输入${fn_label(field)}"/>
				</#if>
			</div>
		</#if>
	</#if>
</#list>

<button type="submit" class="btn btn-primary">提交</button>
<a href="${fn_el("admin")}${urlPath}" class="hs-cancel">
	<button type="button" class="btn btn-default">取消</button>
</a>
<hs:validate className="${entityPackageName}.${entityClassName}"/>
